package user_service_config

import "context"

type User struct {
	Id       string `json:"id"`
	Name     string `json:"name"`
	Username string `json:"username"`
	Email    string `json:"email"`
	Password string `json:"password"`
	Age      int    `json:"age"`
}

type GetUserByIdRequest struct {
	Id string `json:"id"`
}

type GetUserByIdResponse struct {
	Data *User `json:"data"`
}

type UserService struct {
	// error需要作为第二个参数不能放在GetUserByIdResponse中原因：client.BindProxy中无法区别返回值 设置对应error
	GetUserById func(ctx context.Context, req *GetUserByIdRequest) (*GetUserByIdResponse, error)
	TestTimeout func(ctx context.Context, req *GetUserByIdRequest) (*GetUserByIdResponse, error)
}

func (u *UserService) Name() string {
	return "user_service"
}
